package WordFrequent;

import com.sun.istack.internal.Nullable;

import java.io.File;
import java.nio.file.Files;
import java.util.List;

public class readfile {

    public static void getFiles(String path) {

        File file = new File(path);

        if (file.isDirectory() == true){
            File[] files = file.listFiles();
            for (int i = 0 ;i < files.length ; i++){
                if (files[i].isDirectory()){
                    getFiles(files[i].getPath());
                }else{
                    measure.step1(files[i]);
                }
            }
            return;
        }
        else {
            measure.step1(file);
        }


    }


    public static void getFile(String path) {
        File file = new File(path);

        if (file.isDirectory() == true){
            File[] files = file.listFiles();
            for (int i = 0 ;i < files.length ; i++){
                if (files[i].isDirectory()){
                    continue;
                }else{
                    measure.step1(files[i]);
                }
            }
            return;
        }
        else {
            measure.step1(file);
        }
    }
}
